package dao;

import java.sql.SQLException;
import java.util.List;

import entity.OrderDetails;

public interface OrderDao {
	/**
	 * 
	 * @param user_id 用户id
	 * @return 根据用户id查询订单总数
	 * @throws SQLException
	 */
//	public int orderCount(int user_id) throws SQLException;
	/**
	 * 	生成普通订单
	 * @param goods_id 商品id
	 * @return
	 * @throws SQLException
	 */
	public int insertOrder(int user_id,int goods_id) throws SQLException;
	
	/**
	 * 
	 * @param user_id 用户id
	 * @return 根据用户id返回订单id
	 */
	public List<Integer> getOrderIdByUser(int user_id) throws SQLException;
	/**
	 * 生成详细订单
	 * @param user_id 用户id
	 * @return
	 * @throws SQLException
	 */
	public int insertIntoOrderDel(int user_id,int order_id,int total,int num,int state,String sTime,String eTime,int gift)throws SQLException;
	
	/**
	 * 
	 * @param order_id 订单编号
	 * @return	返回该订单对应的商品id
	 * @throws SQLException
	 */
	public List<Integer> getGoodIdByOrderId(int order_id)throws SQLException;
	/**
	 * 
	 * @param user_id 用户id
	 * @return	根据订单id查询到详细订单
	 * @throws SQLException
	 */
	public OrderDetails selOrderDetails(int order_id) throws SQLException;
	/**
	 * 
	 * @param order_id
	 * @return 根据id删除订单
	 * @throws SQLException
	 */
	public int delOrderByOrder_id(int order_id) throws SQLException;
	/**
	 * 
	 * @param order_id
	 * @return 根据id删除订单
	 * @throws SQLException
	 */
	public int delOrderDelByOrder_id(int order_id) throws SQLException;
	/**
	 * 
	 * @param status 状态
	 * @param order_id 需要修改的订单
	 * @return	修改某订单状态
	 * @throws SQLException
	 */
	public int updateStatus(int status,int order_id) throws SQLException;
	/**
	 * 
	 * @param user_id 用户id
	 * @return 用户的订单
	 * @throws SQLException
	 */
	public List<OrderDetails> getAllOrderByid(int user_id) throws SQLException;
}
